package main

import (
	"errors"
	"fmt"
)

func div(a int, b int) (result int, err error) {
	if (0 == b) {
		err = errors.New("b is error")
	} else {
		result = a / b
	}
	return
}

func main() {
	res, err := div(10, 2)
	fmt.Println(res, err) // 0 nil
	res, err = div(10,0)
	fmt.Println(res, err) // 0, b is error
}
